package com.xywy.tangandroid.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xywy.tangandroid.R;
import com.xywy.tangandroid.base.BaseActivity;

/**
 * 手机号
 */
public class PhoneNumberAct extends BaseActivity {
	private RelativeLayout left_img;
	private TextView middle_title;
	private TextView phone_number;
	private RelativeLayout chance_phone_number;
	private String phone_number_str;

	@Override
	protected void initView(Bundle savedInstanceState) {
		setContentView(R.layout.act_phone_number);
		left_img = (RelativeLayout) findViewById(R.id.left_img);
		middle_title = (TextView) findViewById(R.id.middle_title);
		middle_title.setText(getResources().getString(
				R.string.mine_account_phonenumber_str));
		phone_number = (TextView) findViewById(R.id.phone_number);
		chance_phone_number = (RelativeLayout) findViewById(R.id.chance_phone_number);
	}

	@Override
	protected void initListener() {
		left_img.setOnClickListener(this);
		chance_phone_number.setOnClickListener(this);
	}

	@Override
	protected void initData() {
		phone_number_str = getIntent().getStringExtra("phone_number");
		phone_number.setText(phone_number_str);
	}

	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {
		case R.id.left_img:
			finish();
			break;
		case R.id.chance_phone_number:
			// Intent intent = new Intent(this, ChangePhoneNumberAt.class);
			Intent intent = new Intent(this, VerifyOriginPasswordAct.class);// 验证原密码
			intent.putExtra("phone_number", phone_number_str);
			System.out.println("phone_number+++" + phone_number_str);
			startActivity(intent);
			PhoneNumberAct.this.finish();
			break;

		default:
			break;
		}
	}
}
